<html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<body>
<a href="<?=$this->base_url?>">Назад</a>
<h2><?=$this->table->comment?></h2>
<?
	echo '<table border="1"><tr>';
	foreach($this->table->fields as $field)
	{
		if ($field['comment']) echo '<td>'.$field['comment'].'</td>';
	}
	echo '<td><a href="'.$this->base_url.'edit?name='.$this->table->name.'">A</a></td>';
	echo '</tr>';

	foreach($this->data as $row)
	{
		echo '<tr>';
		foreach($this->table->fields as $field)
		{
			if ($field['comment']) echo '<td>'.$row[$field['name']].'</td>';
		}
		echo '<td><a href="'.$this->base_url.'edit?name='.$this->table->name.'&f_id='.$row['id'].'">E</a>';
		echo ' <a href="'.$this->base_url.'delete?name='.$this->table->name.'&f_id='.$row['id'].'">X</a></td>';
		echo '</tr>';
	}
	echo '</table>';
	
	//print_r($this->table->fields);
	//print_r($this->data);
?>
</body>
</html>